﻿using Abp.ObjectMapping;
using AVIS.OutBound.FrequentTravellerpartner.Dto;
using AVIS.OutBound.FrequentTravellerPartners;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AVIS.OutBound.FrequentTravellerpartner
{
    /// <summary>
    /// 合作伙伴常旅客卡号
    /// </summary>
    public class FrequentTravellerpartnerAppService : OutBoundAppServiceBase, IFrequentTravellerpartnerAppService
    {
        #region 构造函数
        private readonly IObjectMapper _objectMapper;
        private readonly IFrequentTravellerPartnerManger _ftManger;

        /// <summary>
        /// 构造函数
        /// </summary>
        public FrequentTravellerpartnerAppService(
            IFrequentTravellerPartnerManger ftManger,
            IObjectMapper objectMapper)
        {
            _ftManger = ftManger;
            _objectMapper = objectMapper;
        }
        #endregion

        /// <summary>
        /// 合作伙伴常旅客卡号
        /// </summary>
        /// <returns></returns>
        public List<FrequentTravellerpartnerOutput> AllFrequentTravellerpartner()
        {
            var cacheItem = _ftManger.AllFrequentTravellerpartner();
            return _objectMapper.Map<List<FrequentTravellerpartnerOutput>>(cacheItem);
        }
    }
}
